# -*- coding: utf-8 -*- 
'''
Created on 2012-2-25

@author: TOM
'''
from website.constant import SUPER_POWER


def getCompanyTuple(request):
    CurrentUser=request.session.get('CurrentUser')
    company=CurrentUser.employe.company
    return (company.id,company.en_name)
    
def getEmployeId(request):
    # 获取员工ID
    CurrentUser=request.session.get('CurrentUser')
    if CurrentUser.employe is None:
        return None
    return CurrentUser.employe.id
    
def getCURoleId(request):
    # 固定 1 超级管理员
    CurrentUser=request.session.get('CurrentUser')
    if CurrentUser.is_superuser == SUPER_POWER:
        return SUPER_POWER
    return CurrentUser.role.id

